<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

defined('IN_ADMIN') or die('Hacking Attempt!');

func::isLogin();
mysql::begin(0);

$iCustomerId = (isset($_GET['id']) && is_numeric($_GET['id'])) ? $_GET['id'] : 0;

//customer
$sSql = 'SELECT * FROM customer WHERE customerId='. $iCustomerId;
$aResult = mysql::querySql($sSql);
$aCustomerRow = mysql::fetchSql($aResult);

//debit
$sSql = 'SELECT amount FROM debit WHERE customerId='. $iCustomerId;
$aResult = mysql::querySql($sSql);
$aDebitRow = mysql::fetchSql($aResult);

//order
$sSql = 'SELECT * FROM tnf.order WHERE customerId='. $iCustomerId .' ORDER BY date DESC';
$aOrderResult = mysql::querySql($sSql);

//payment
$sSql = 'SELECT * FROM payment WHERE customerId='. $iCustomerId .' ORDER BY date DESC';
$aPaymentResult = mysql::querySql($sSql);
?>
